<template>
	<div>
		<div class="flex flex-row-between "
			style="padding: 20px 150px;background: linear-gradient(180deg, #3CB4FE 0%, #328DFB 100%);<strong></strong>">
			<div @click="back"
				style="cursor: pointer; color: #fff; line-height: 40px; width:150px;height: 40px;border: 1px solid #fff;text-align: center;">
				返回
			</div>
			<div style="color:#fff ;" class="flex flex-col-center u-font-20 font-bold">

				<span class="u-margin-right-20">{{user.realname}}</span>
				<el-dropdown @command="dropdown">
					<i class="el-icon-switch-button font-bold " style="color:#fff ;font-size: 20px;"></i>
					<el-dropdown-menu slot="dropdown">
						<el-dropdown-item command='back'>退出</el-dropdown-item>
					</el-dropdown-menu>
				</el-dropdown>
			</div>
		</div>

	</div>
</template>
<script>
	export default {
		name: 'baseBack',
		props: {

		},

		data() {
			return {
				user: {},
				
			}
		},
		created() {
			this.getInfomation()
		},
		// watch:{
		// 	font:{
		// 		immediate:true,
		// 		handler(v){
		// 			console.log(v)
		// 			if(v){
		// 				this.$emit('font',v)
		// 			}
		// 		}
		// 	}
		// },
		methods: {
		
			dropdown(e) {
				if (e == 'back') {
					window.localStorage.removeItem('userInfo')
					this.$router.replace('/register')
				}
			},
			getInfomation() {
				this.axios.post("/user/information", ).then(res => {
					this.user = res;
				}).catch(error => {})


			},
			back() {
				this.$router.go(-1)
			}
		}
	}
</script>

<style scoped>

</style>
